﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Microsoft.Practices.ServiceLocation;
using Caliburn.Autofac;
using Autofac;
using Caliburn.Core;
using PCUserTimer.ViewModels;
using Caliburn.PresentationFramework.ApplicationModel;

namespace PCUserTimer
{
    public partial class App 
    {
        protected override IServiceLocator CreateContainer()
        {
            var builder = new ContainerBuilder();

            builder.RegisterAssemblyTypes(typeof(MainViewModel).Assembly).InNamespaceOf<MainViewModel>();

            var container = builder.Build();

            return new AutofacAdapter(container);
        }

        protected override object CreateRootModel()
        {
            return Container.GetInstance<MainViewModel>();
        }
    }
}
